import request from '@/utils/request'
import apis from './'

export function getContractList (parameter) {
  return request({
    url: apis.ContractList,
    method: 'get',
    params: parameter
  })
}

export function getContractDetail (id) {
  return request({
    url: `${apis.ContractDetail}?contract_id=${id}`,
    method: 'get'
  })
}

export function getContractBusiness (parameter) {
  return request({
    url: apis.ContractBusiness,
    method: 'get',
    params: parameter
  })
}

export function getContractPayment (parameter) {
  return request({
    url: apis.ContractPayment,
    method: 'get',
    params: parameter
  })
}

export function getContractAddress (parameter) {
  return request({
    url: apis.ContractAddress,
    method: 'get',
    params: parameter
  })
}

export function getContractHistory (parameter) {
  return request({
    url: apis.ContractHistory,
    method: 'get',
    params: parameter
  })
}

export function getEditContract (id) {
  return request({
    url: `${apis.EditContract}?contract_id=${id}`,
    method: 'get'
  })
}

export function postEditContract (id, data) {
  return request({
    url: `${apis.EditContract}?contract_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getContractTransfer (parameter) {
  return request({
    url: apis.ContractTransfer,
    method: 'get',
    params: parameter
  })
}
